﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FileUpload.aspx.cs" Inherits="main_comm_FileUpload" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
 <link href="../../css/cde.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="../../js/fileupload.js" charset="utf-8"></script>
  <script type="text/javascript">
    function clearForm()
 {
//    document.getElementById("txt_description").value = "";
//    document.getElementById("hiddPath").value = "";
//    document.getElementById("hiddValue").value = "ww";
//    document.getElementById("preview").value = "";
    window.returnValue = "";
    window.close();
 }
</script>
    <title><asp:Literal id="title" runat="server" Text="<%$Resources:ResourceAdmin,IMAGE_UPLOAD%>"></asp:Literal><</title>
</head>
<base target="_self">
<body style ="background-color:#F7F8FB">
    <form id="form1" runat="server">
    <div align="center">
    <div align="center" style="font-size:x-large; color:#37385A"><asp:Literal id="Literal1" runat="server" Text="<%$Resources:ResourceAdmin,IMAGE_UPLOAD%>"></asp:Literal></div>
    <table align="center" class="tbl1" cellspacing="0" id="dgProperties" style="border-width:0px;border-collapse:collapse;">
         <tr>
            <td colspan="2">
            &nbsp;
            </td>
        </tr>
        <tr>
              <th class="blue" align="right">
                <asp:Literal runat="server" ID="lblName" Text="<%$Resources:ResourceAdmin,IMAGE_UPLOAD %>"></asp:Literal>
              </th>
              <td class="blue" align="left">
                <asp:FileUpload ID="fileUpload" runat="server"/>
              </td>
         </tr>
         <tr>
               <th class="blue" align="right">
                <asp:Literal runat="server" ID="lblLabel" Text="<%$Resources:ResourceAdmin,IMAGE_DESCRIPTION %>"></asp:Literal>
              </th>
              <td class="blue" align="left">
                 <input type="text" size="22" id="txt_description" maxlength="30" runat="server" />
              </td>
         </tr>
          <tr>
            <td colspan="2">
            &nbsp;
            </td>
        </tr>    
        </table>
        <div runat="server" id="preview" style="width:400px;height:350px;" class="imageFilter" align="center"></div>
        </div>
        <br/>
        <div align="center">
        <asp:Button  ID="cmdUpload" runat="server" Width="50" Text="<%$Resources:ResourceAdmin,UPLOAD %>"  class="commandDBtn" onmouseenter="document.all('cmdUpload').className = 'commandSBtn';" onmouseleave="document.all('cmdUpload').className = 'commandDBtn';" OnClick="cmdUpload_Click"/>
        <%if (this.hidRowId.Value == string.Empty)
          {%>
        <asp:Button  ID="cmdClear" runat="server" Width="50" Text="<%$Resources:Resource,BTN_CLEAR %>"  class="commandDBtn" onmouseenter="document.all('cmdClear').className = 'commandSBtn';" onmouseleave="document.all('cmdClear').className = 'commandDBtn';" OnClientClick="clearForm()"/>
        <%} %>
        <asp:Button  ID="cmdClose" runat="server" Width="50" Text="<%$Resources:Resource,BTN_CLOSE %>"  class="commandDBtn" onmouseenter="document.all('cmdClose').className = 'commandSBtn';" onmouseleave="document.all('cmdClose').className = 'commandDBtn';" OnClientClick="window.close()"/> 
        </div>
        <asp:HiddenField ID="hiddPath" runat="server" />
        <asp:HiddenField ID="hiddValue" runat="server" />
        <asp:HiddenField ID="hidRowId" runat="server" />
        <asp:HiddenField ID="hidTableId" runat="server" />
        <asp:HiddenField ID="hidColId" runat="server" />
        <asp:HiddenField ID="hidUpfile" runat="server" />
         <asp:HiddenField ID="hiddCheckMsg" runat="server" value="<%$Resources:ResourceAdmin,IMAGE_TYPE %>"/>
         <asp:HiddenField ID="hiddSelectMsg" runat="server" value="<%$Resources:ResourceAdmin,IMAGE_TYPE_SELECT %>"/>
    </form>
</body>
 <script type="text/javascript">
    var fileName = document.getElementById("hiddPath").value;
    var divObj = document.getElementById("preview");
    	
    if (fileName != null)
    {
	    try {
	    divObj.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = fileName;
	    } catch(ex)
	    { }
    }
</script>
</html>
